package com.spa.infrastructure.enums.dict.order;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum OrderSubStatusEnum {

    $10(10, "未支付"),
    $20(20, "已支付"),
    $30(30, "等待超时取消"),
    ;

    private final Integer code;

    private final String desc;

    public static OrderSubStatusEnum byCode(int code) {
        for (OrderSubStatusEnum value : values()) {
            if (value.code == code) return value;
        }
        return null;
    }

}
